BIN_DIR = ./output

env-dev:export RUNMODE=dev
env-dev:
	@echo $(RUNMODE)

env-online:export RUNMODE=online
env-online:
	@echo $(RUNMODE)

env-test:export RUNMODE=test
env-test:
	@echo $(RUNMODE)

output:
	mkdir $(BIN_DIR)

clean:
	rm -rf $(BIN_DIR)

cfg:
	cp -r ./logs $(BIN_DIR)
	cp -r ./configs $(BIN_DIR)

build-http_proxy:
	-rm  -rf $(BIN_DIR)/http_proxy
	go build -o $(BIN_DIR)/http_proxy main.go

run-http_proxy: build-http_proxy
	-ps -ef|grep http_proxy|grep -v grep|awk '{print $$2}'|xargs kill -9
	nohup $(BIN_DIR)/http_proxy > $(BIN_DIR)/ad-http_proxy.out 2>&1 &

build: build-http_proxy


run: run-http_proxy


dev: env-dev run

test: env-test run

online: env-online run
